package jp.sourceforge.talisman.mds;

public class MdsMethodWee {
	private Table<String> table;
	private MdsMethod<String> mds;

	private static final double HYOGO_X = 35.073617d;
	private static final double HYOGO_Y = -71.860761d;
	private static final double WAKAYAMA_X = -85.916950d;
	private static final double WAKAYAMA_Y = -16.798861d;
	private static final double SHIGA_X = 33.797354d;
	private static final double SHIGA_Y = 65.012338d;
	private static final double KYOTO_X = 58.626458d;
	private static final double KYOTO_Y = -6.731186d;
	private static final double NARA_X = -32.0976517d;
	private static final double NARA_Y = 19.3428728d;
	private static final double OSAKA_X = -9.482827d;
	private static final double OSAKA_Y = 11.035597d;

	public void setUp(){
		table = new Table<String>();
		table.addValue("京都", "兵庫",   60);
		table.addValue("京都", "和歌山", 142);
		table.addValue("京都", "大阪",   83);
		table.addValue("京都", "奈良",   95);
		table.addValue("京都", "滋賀",   61);

		table.addValue("滋賀", "兵庫",   136);
		table.addValue("滋賀", "和歌山", 144);
		table.addValue("滋賀", "大阪",   32);
		table.addValue("滋賀", "奈良",   79);

		table.addValue("奈良", "兵庫",   116);
		table.addValue("奈良", "和歌山",  68);
		table.addValue("奈良", "大阪",   75);

		table.addValue("大阪", "兵庫",   85);
		table.addValue("大阪", "和歌山",  68);

		table.addValue("兵庫", "和歌山",  132);
		mds = new MdsMethod<String>(table);
	}
	public void testCoordinateIterator(){
		System.out.println(table);
		for(Item c: mds){
			if(c.getName().equals("兵庫")){
				System.out.println(HYOGO_X - c.get(0).doubleValue());
				System.out.println(HYOGO_Y - c.get(1).doubleValue());
			}
			else if(c.getName().equals("和歌山")){
				System.out.println(WAKAYAMA_X - c.get(0).doubleValue());
				System.out.println(WAKAYAMA_Y - c.get(1).doubleValue());
			}
			else if(c.getName().equals("滋賀")){
				System.out.println(SHIGA_X - c.get(0).doubleValue());
				System.out.println(SHIGA_Y - c.get(1).doubleValue());
			}
			else if(c.getName().equals("京都")){
				System.out.println(KYOTO_X - c.get(0).doubleValue());
				System.out.println(KYOTO_Y - c.get(1).doubleValue());
			}
			else if(c.getName().equals("奈良")){
				System.out.println(NARA_X - c.get(0).doubleValue());
				System.out.println(NARA_Y - c.get(1).doubleValue());
			}
			else if(c.getName().equals("大阪")){
				System.out.println(OSAKA_X - c.get(0).doubleValue());
				System.out.println(OSAKA_Y - c.get(1).doubleValue());
			}
		}
	}
	public static void main(String[] args) {
		MdsMethodWee wee = new MdsMethodWee();
		wee.setUp();
		wee.testCoordinateIterator();
	}
}
